#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
	int arr[100] = { 0 };
	int i = 0, c1 = 0, c2 = 0;
	int n = 0;
	scanf("%d", &n);
	for (i = 0; i < n; i++)
	{
		scanf("%d", &arr[i]);
	}
	for (i = 0; i < n - 1; i++)
	{
		if (arr[i] - arr[i + 1] < 0)
			c1++;
		else if (arr[i] - arr[i + 1] > 0)
			c2++;
		else
		{
			c1++;
			c2++;
		}
	}
	if (c1 == n - 1 || c2 == n - 1)
		printf("sorted\n");
	else
		printf("unsorted\n");
	return 0;
}